//
//  ViewController.m
//  王宇先_03_登录注册
//
//  Created by wyx on 16/3/11.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "ViewController.h"
#import "MyButton.h"
#import "ViewController.h"
#import "LTView.h"
#import "ViewControllerOfEnter.h"
#import "ViewControllerOfFind.h"
#import "ViewControllerOfLogin.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = [UIColor lightGrayColor];
    
    LTView *viewOfUserNmae = [[LTView alloc] initWithFrame:CGRectMake(40, 80, self.view.frame.size.width - 80, 40) withText:@"用户名:" placeHolder:@"请输入用户名"];
    [self.view addSubview:viewOfUserNmae];
    [viewOfUserNmae release];
    LTView *viewOfKey = [[LTView alloc] initWithFrame:CGRectMake(40, 160, self.view.frame.size.width - 80, 40) withText:@"密码:" placeHolder:@"请输入密码"];
    [self.view addSubview:viewOfKey];
    [viewOfKey release];
    //按钮
    MyButton *buttonOfEnter = [MyButton buttonWithType:UIButtonTypeSystem];
    buttonOfEnter.frame = CGRectMake(75, 240, 50, 40);
    [buttonOfEnter setTitle:@"登录" forState: UIControlStateNormal];
    buttonOfEnter.titleLabel.font = [UIFont systemFontOfSize:23];
    [buttonOfEnter setTitleColor:[UIColor colorWithRed:0 green:145 blue:249 alpha:1] forState:UIControlStateNormal];
    [self.view addSubview:buttonOfEnter];
    [buttonOfEnter addTarget:self action:@selector(handleOfEnter) forControlEvents:UIControlEventTouchUpInside];
    [buttonOfEnter release];
    
    MyButton *buttonOfFind = [MyButton buttonWithType:UIButtonTypeSystem];
    buttonOfFind.frame = CGRectMake(155, 240, 100, 40);
    [buttonOfFind setTitle:@"找回密码" forState: UIControlStateNormal];
    buttonOfFind.titleLabel.font = [UIFont systemFontOfSize:23];
    [buttonOfFind setTitleColor:[UIColor colorWithRed:0 green:145 blue:249 alpha:1] forState:UIControlStateNormal];
    [self.view addSubview:buttonOfFind];
    [buttonOfFind addTarget:self action:@selector(handleOfFind) forControlEvents:UIControlEventTouchUpInside];
    [buttonOfFind release];
    
    MyButton *buttonOfLogin = [MyButton buttonWithType:UIButtonTypeSystem];
    buttonOfLogin.frame = CGRectMake(285, 240, 50, 40);
    [buttonOfLogin setTitle:@"注册" forState: UIControlStateNormal];
    buttonOfLogin.titleLabel.font = [UIFont systemFontOfSize:23];
    [buttonOfLogin setTitleColor:[UIColor colorWithRed:0 green:145 blue:249 alpha:1] forState:UIControlStateNormal];
    [self.view addSubview:buttonOfLogin];
    [buttonOfLogin addTarget:self action:@selector(handleOfLogin) forControlEvents:UIControlEventTouchUpInside];
    [buttonOfLogin release];
    
}
- (void)handleOfEnter {
    ViewControllerOfEnter *viewEnter = [[ViewControllerOfEnter alloc] init];
    [self presentViewController:viewEnter animated:YES completion:^{
    }];
    [viewEnter release];
}
- (void)handleOfFind {
    ViewControllerOfFind *viewFind = [[ViewControllerOfFind alloc] init];
    [self presentViewController:viewFind animated:NO completion:^{
    }];
    [viewFind release];
}
- (void)handleOfLogin {
    ViewControllerOfLogin *viewLogin = [[ViewControllerOfLogin alloc] init];
    [self presentViewController:viewLogin animated:YES completion:^{
    }];
    [viewLogin release];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
